home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 May: Tool Chest / Dev.CD May 97 TC.toast / Sample Code / Development Tools & Languages / AppsToGo / DTS.Lib / TUndoObj.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  2.5 KB  |  96 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** Program:     DTS.Lib
  5. ** File:        TUndoObj.c
  6. ** Written by:  Eric Soldan
  7. **
  8. ** Copyright © 1992 Apple Computer, Inc.
  9. ** All rights reserved.
  10. */
  11.  
  12. /* You may incorporate this sample code into your applications without
  13. ** restriction, though the sample code has been provided "AS IS" and the
  14. ** responsibility for its operation is 100% yours.  However, what you are
  15. ** not permitted to do is to redistribute the source as "DSC Sample Code"
  16. ** after having made changes. If you're going to re-distribute the source,
  17. ** we require that you make it clear in the source that the code was
  18. ** descended from Apple Sample Code, but that you've made changes. */
  19.  
  20. #ifndef __OSEVENTS__
  21. #include <OSEvents.h>
  22. #endif
  23.  
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27.  
  28. #ifndef __QUICKDRAW__
  29. #include <Quickdraw.h>
  30. #endif
  31.  
  32. #ifndef __TREEOBJ__
  33. #include "TreeObj.h"
  34. #endif
  35.  
  36. #ifndef __UTILITIES__
  37. #include "Utilities.h"
  38. #endif
  39.  
  40.  
  41.  
  42. /**********************************************************************/
  43. /**********************************************************************/
  44.  
  45. #ifdef applec
  46. #pragma segment ATGTreeObj
  47. #endif
  48.  
  49. /**********************************************************************/
  50. /**********************************************************************/
  51.  
  52.  
  53.  
  54. long    TUndoObj(TreeObjHndl hndl, short message, long data)
  55. {
  56.     char    *cptr;
  57.  
  58.     switch (message) {
  59.         case VHMESSAGE:
  60.             cptr = ((VHFormatDataPtr)data)->data;
  61.             ccatchr   (cptr, 13, 2);
  62.             ccat      (cptr, "$10: TUndoObj:");
  63.             ccatchr   (cptr, 13, 1);
  64.             ccat      (cptr, "  $00: root         = $");
  65.             ccatpadhex(cptr, '0', 8, 8, (long)mDerefUndo(hndl)->root);
  66.             ccatchr   (cptr, 13, 1);
  67.             ccat      (cptr, "  $04: frHndl       = $");
  68.             ccatpadhex(cptr, '0', 8, 8, (long)mDerefUndo(hndl)->frHndl);
  69.             ccatchr   (cptr, 13, 1);
  70.             ccat      (cptr, "  $08: disabled     = ");
  71.             ccatdec   (cptr, mDerefUndo(hndl)->disabled);
  72.             ccatchr   (cptr, 13, 1);
  73.             ccat      (cptr, "  $0A: lastEditType = ");
  74.             ccatdec   (cptr, mDerefUndo(hndl)->lastEditType);
  75.             ccatchr   (cptr, 13, 1);
  76.             ccat      (cptr, "  $0C: undoDepth    = ");
  77.             ccatdec   (cptr, mDerefUndo(hndl)->undoDepth);
  78.             ccatchr   (cptr, 13, 1);
  79.             ccat      (cptr, "  $0E: maxNumUndos  = ");
  80.             ccatdec   (cptr, mDerefUndo(hndl)->maxNumUndos);
  81.             ccatchr   (cptr, 13, 1);
  82.             ccat      (cptr, "  $10: numSaveUndos = ");
  83.             ccatdec   (cptr, mDerefUndo(hndl)->numSaveUndos);
  84.             return(true);
  85.             break;
  86.  
  87.         default:
  88.             break;
  89.     }
  90.  
  91.     return(noErr);
  92. }
  93.  
  94.  
  95.  
  96.